package studentdemo.server;

import studentdemo.dao.MajorDao;
import studentdemo.dao.MajorDaoImpl;
import studentdemo.modul.Major;
import java.util.List;

public class MajorService {
    private final MajorDao majorDao = new MajorDaoImpl();

    public boolean addMajor(Major major) {
        return majorDao.insertMajor(major) > 0;
    }

    public boolean updateMajor(Major major) {
        return majorDao.updateMajor(major) > 0;
    }

    public boolean deleteMajor(String mno) {
        return majorDao.deleteMajor(mno) > 0;
    }

    public Major getMajorById(String mno) {
        return majorDao.getMajorById(mno);
    }

    public List<Major> getAllMajors() {
        return majorDao.getAllMajors();
    }
} 